 <table cellspacing="0" class="snapol_table">
    <tbody>
        <tr>
        <td></td>
        
<?php 

// style="position: fixed;"


$rowColumn = explode(",", "[php_property:row_field]");
$rowTotal = array();
$columnTotal = array();
$nmField = "[php_property:nm_field]";



foreach (db::getData("[php_property:column_table]") as $dataColumn) {

//$queryColumn="SELECT * FROM [php_property:column_table]";
//$resultColumn=mysql_query($queryColumn);
//while ($lineColumn=mysql_fetch_array($resultColumn)) { 
  //  $lineColumn=array_change_key_case($lineColumn);
    $columnTotal[] = 0;
    ?>        

            <td width="250"><?php 
            
            foreach (general::stringToArray("[php_property:column_field]") as $columnField) {
                //echo $dataColumn['[php_property:column_field]']; 
                echo $dataColumn[$columnField]." "; 
            }
            
            
            ?>
            </td>
<?php } 

//mysql_free_result($resultColumn);

?>           
            
        </tr>
    </tbody> 
<?php 

foreach (db::getData("[php_property:row_table]", "[php_property:row_orderby]") as $dataRow) {
                                    

?>               
        <tr>
            <td nowrap="nowrap">
                <?php 
                //echo $lineRow['[php_property:Row_field]']; 
                for ($n=0; $n<sizeof($rowColumn); $n++) {
                     //echo $lineRow[$rowColumn[$n]]." "; 
                     echo $dataRow[$rowColumn[$n]]." "; 
                     
                }
                
                
                ?>
</td>
<?php 

//SELECT * FROM gruppen left JOIN (select * from verein_gruppen where _verein=273) a ON (gruppen.id=_gruppen)  
$queryJoinRow="SELECT * FROM [php_property:column_table] LEFT JOIN 
    (SELECT * FROM [php_property:nm_table] WHERE _[php_property:row_table]='".$dataRow['id']. "') a 
     ON [php_property:column_table].id=_[php_property:column_table]";


//$resultJoinRow=mysql_query($queryJoinRow);
$counterColumn = 0;

foreach (db::getQuery($queryJoinRow) as $joinRow) {

//while ($lineJoinRow=mysql_fetch_array($resultJoinRow)) { 
  //  $lineJoinRow=array_change_key_case($lineJoinRow);
    
                   
                 
                   //$lineJoinRow['[php_property:JoinRow_field]']; 
                 if (!is_null($joinRow['_[php_property:column_table]'])) {
                 
                     if ($nmField !== "") {
                         echo '<td style="background-color:#093"1">'.$joinRow[$nmField].'</td>';
                     } else {
                        echo '<td style="background-color:#093"1">&nbsp;</td>';
                     }

                  $columnTotal[$counterColumn] =$columnTotal[$counterColumn]+1;   
                 }  else { 
                     echo "<td>&nbsp;</td>";
                     //$columnTotal[$counterColumn] =$columnTotal[$counterColumn]+1;   
                 } 
                 $counterColumn++;
                ?>   
       
        
<?php } 
//mysql_free_result($resultJoinRow);?>           
        
     </tr>       
        
<?php } 

//mysql_free_result($resultRow);
?>        
  
  
  <tr>
  <td><b>Total</b></td>
  
  <?php
    
    for ($n=0; $n < sizeof($columnTotal);$n++) {
        
        echo "<td>".$columnTotal[$n]."</td>";
        
        
    }
    
    
?>
  
  </tr>
</table>
